﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Spread.Master" AutoEventWireup="true" CodeBehind="Overview.aspx.cs" Inherits="ControlExplorer.samples.ExcelCompatibility.Overview" %>
<%@ Register Assembly="FarPoint.Web.Spread"
    Namespace="FarPoint.Web.Spread" TagPrefix="FarPoint" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <script type="text/javascript">
    function fileSelectedChanged() {
      var filePath = document.getElementById('myFile').value;

      var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
      var isOk = ((ext == 'xls') || (ext == 'xlsx'));

      if (!isOk) {
        alert('Only .XLS and .XLSX files are allowed');
        return false;
      }
      document.getElementById('form1').submit();
    }
  </script>
  <br />
  <div style="position: relative; height: 510px; overflow: hidden">
    <FarPoint:FpSpread ID="FpSpread1" runat="server" Width="770px" Height="400px" BorderStyle="Solid" BorderWidth="1px"
      BorderColor="Black" DesignString='<?xml version="1.0" encoding="utf-8"?><Spread />' EnableTheming="True">
      <Sheets>
        <FarPoint:SheetView
          GridLineColor="#D0D7E5" SelectionBackColor="#EAECF5" SheetName="Sheet1">
        </FarPoint:SheetView>
      </Sheets>
      <TitleInfo BackColor="#E7EFF7" Font-Size="X-Large" HorizontalAlign="Center">
      </TitleInfo>
      <HierBar Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
        Font-Underline="False" />
      <Pager Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
        Font-Underline="False" />
    </FarPoint:FpSpread>
    <br />
    <p style="margin-top: 10px">
      <input type="file" id="myFile" name="myFile" />&nbsp;<asp:Button ID="Button3" runat="server" Text="导入 Excel" OnClick="Button3_Click" OnClientClick="return fileSelectedChanged();" CausesValidation="true" />
    </p>
    <br />
    <asp:Button ID="Button1" runat="server" Text="导出到 Excel 2003" OnClick="Button1_Click" />&nbsp;
    <asp:Button ID="Button2" runat="server" Text="导出到 Excel 2007" OnClick="Button2_Click" />
  </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Description" runat="server">
    <p>
      Spread 可以导入或者导出  97 或者更高版本的 Excel 文件,这将允许您在线编辑、共享模板。
    </p>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ControlOptions" runat="server">
</asp:Content>
